package selef.xiafan.entity.system;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @author xiafan
 * @version 1.0
 * @date 2021/7/21 22:35
 */
@Entity
@Data
@Table(name = "t_stock")
@JsonIgnoreProperties({"handler", "hibernateLazyInitializer"})
public class Stock implements Serializable {
    @Id
    private String stockId;

    private String name;

    @Column(name = "descript")
    private String description;

    /*
     * 入库时间
     * */
    @DateTimeFormat(pattern = "yyyy-MM-dd hh-mm-ss")
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "GMT+8"
    )
    private Date warehousingDate;

    private String createBy;

    /*
     * 预警数量
     * */
    @Column(name = "warn_num")
    private Integer warn;

    /*
     * 进货总价
     * */
    private BigDecimal purchasePrice;

    /*
     * 出货单价
     * */
    private BigDecimal sellPrice;

    /*
     * 进货数量
     * */
    private Integer purchaseNum;

    /*
     * 剩余数量
     * */
    @Column(name = "remaining_amount")
    private Integer remainAmount;

    /*
    * 是否上架
    * */
    private Boolean enable;

    /*
    * 进货总量
    * */
    private Integer purchaseTotal;
    /*
    * 供应商
    * */
    private String supplier;
}
